varying float depth;
void main() {
    vec4 pos = gl_ModelViewMatrix * gl_Vertex;
    depth = pos.z;
    gl_Position = gl_ProjectionMatrix * pos;
}